import SwiftUI

/*
 * 图层示例
 */
class DivExample: FCUIView{
    /*
     * 初始化布局
     */
    override func onLoad(){
        let isInit = super.m_isInit
        super.onLoad()
        if !isInit{
            m_paint.defaultUIStyle = "light"
            let width = Double(self.frame.size.width), height = Double(self.frame.size.height)
            renderFaceCat(name:"divexample", paint: m_paint, size: FCSize(cx:width, cy:height))
            let tabPage = findViewByName(name:"TabPage2", views:m_paint.views)
            let div = FCDiv()
            div.location = FCPoint(x:50, y:50)
            div.size = FCSize(cx:200, cy:200)
            div.showHScrollBar = true
            div.showVScrollBar = true
            addViewToParent(view:div, parent:tabPage)
            for i in 0...10{
                let button = FCButton()
                button.location = FCPoint(x:Double(i * 40), y:Double(i * 40))
                button.size = FCSize(cx:100, cy:20)
                addViewToParent(view:button, parent:div)
                button.text = "确定"
            }
        }
    }
}
